package world;

import java.util.List;
import java.util.ArrayList;

import world.Levels.*;

public class LevelManager 
{
	private int currentLevel;	//<-- list index
	private List<LevelInterface> levels;
	
	private static LevelManager instance;
	
	private LevelManager()
	{
		currentLevel = 0;
		levels = new ArrayList<LevelInterface>();
		
		createLevels();
		loadLevels();
	}
	
	public static LevelManager getInstance()
	{
		if(instance == null) {
			instance = new LevelManager();
		}
	
		return instance;
	}
	
	private void createLevels()
	{
		levels.add(new Level_1_instance());
	}
	
	private void loadLevels()
	{
		for(LevelInterface li : levels)
		{
			li.createLevel();
		}
	}
	
	public Level getCurrentLevel()
	{
		return levels.get(currentLevel).getLevel();
	}
}
